#ifndef MESH_H
#define MESH_H

#include <GL/gl.h>
#include <vector>
#include <iostream>

#include "Triangle.h"
#include "Vertex3D.h"

using namespace std;

class Mesh {

	protected :
		/** Triangles of the mesh */
		vector<Triangle *> triangs;
		/** Vertices of the mesh */			
		vector<Vertex3D *> verts;
		/** Center of mass of the mesh */
		Vertex3D com;
		/**State of the mesh */
		TState state;		


	
	public :
		
		Mesh ();
		Mesh (Mesh &m);
		~Mesh ();	
		
		/** \brief Adds new vertex to mesh
 		 * \param t : vertex to add */
		void add_vertex (Vertex3D *v);
		/** \brief Adds new triangle to mesh
 		 * \param t : triangle to add */
		void add_triangle (Triangle *t);

		/** \return Vector of triangles */
		vector<Triangle *> get_triangs ();
		/** \return Vector of vertices */
		vector<Vertex3D *> get_verts ();		
		
		/** \brief Returns the n'th triangle of the mesh */
		Triangle *get_triangle (GLuint n);
		/** \brief Returns the n'th vertex of the mesh */
		Vertex3D *get_vertex (GLuint n);
		
		/** \brief Returs the center of mass of the mesh */
		Vertex3D get_com();

		/** \brief Returns the state of the mesh */ 
		TState get_state();
		
		/** \brief Set the state of the mesh */
		void set_state(TState);
};


#endif 
